package lanqiao;
/**
 * @Project : AlgorithmLearning
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q0193.java
 * @Author : WangRuoyu
 * @Date : 2023/3/20 16:45
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q0193 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");

        int m = Integer.parseInt(words[0]);
        int n = Integer.parseInt(words[1]);

        words = br.readLine().split(" ");

        long res = 0;
        if (n == 0) {
            for (int i = 0; i < n + m + 1; ++i) {
                res += Integer.parseInt(words[i]);
            }
        } else {
            int min = Integer.MAX_VALUE;
            int max = Integer.MIN_VALUE;

            for (int i = 0; i < n + m + 1; ++i) {
                int x = Integer.parseInt(words[i]);
                min = Math.min(min, x);
                max = Math.max(max, x);
                res += Math.abs(x);
            }
            if (min > 0) {
                res -= 2L * min;
            }
            if (max < 0) {
                res += 2L * max;
            }
        }
        System.out.println(res);
    }
}
